package two.chapter_1.c1_3;

import edu.princeton.cs.algs4.StdOut;


public class Ex1_3_42 {

    public static void main(String[] args) {
        Stack<Integer> q = new LinkStack<>();
        q.push(1);
        q.push(2);
        q.push(3);
        q.push(4);
        q.push(5);

        Stack<Integer> r = new LinkStack<>(q);

        for (Integer i : r) {
            StdOut.print(i);
        }
        StdOut.println();
        for (Integer i : q) {
            StdOut.print(i);
        }
    }


}
